﻿@inject NavigationManager NavigationManager
@inject IDataCacheService _dataCacheService

<CnGalWebSite.Components.Containers.MasaTitleContainer Title="密码" Icon="fa fa-fw  fa-key" Class="h-100">
    <div style="display: flex; flex-direction: column; justify-content: space-between;">
        <span>定期修改密码可提高账户安全性</span>
        @if (Model.LastChangePasswordTime != null)
        {
            <span>@($"上次修改密码：{Model.LastChangePasswordTime.Value.ToTimeFromNowString() }")</span>
        }


        <div style="display: flex; justify-content: flex-end;">
            <div>
                <MButton Text Block  OnClick="OnClick" Color="primary">
                    <MIcon Left>mdi-pencil</MIcon>
                    修改密码
                </MButton>

            </div>
        </div>
    </div>
</CnGalWebSite.Components.Containers.MasaTitleContainer>

@code {
    [Parameter]
    public EditUserDataViewModel Model { get; set; } = new EditUserDataViewModel();

    public void OnClick()
    {
        NavigationManager.NavigateTo("/account/ChangePassword/" + ToolHelper.Base64EncodeUrl(NavigationManager.Uri));
        
    }
}
